#!/usr/bin/env python
# -*- coding: utf-8 -*-


import wx
from core import Core
from core.ui.menu import Menu
from ui.panel import OptionPanel
from core.event.mouseevent import MouseEvent
from core.ide.datamangager import DataMangager
from core.ide.commandmanager import CommandManager

class Extend():
    def __init__(self):
        self.id="OPTIONMENU"
        self.name="Option Panel"
        self.win=None
        CommandManager().listener("settings/open",self.onOpen)
        
    def enable(self):
        Core().getMenu().quickMenu('Edit','|option','Settings').setCommand("settings/open")
    
    def disable(self):
        pass
    
    def onOpen(self,e=None):
        reload(ui.panel)
        DataMangager().getData("Druid","Check update on start",False)
        DataMangager().getData("Druid","TestEnum",1,["1","2","3","4","5"])
        
        #print("onOpen")
        if self.win:
            self.win.Close()
            del self.win
        self.win=OptionPanel()
        self.win.Show(True)


